package com.kushe.entity;

import com.kushe.util.core.DbUtils;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

/**
 * Created by WhiteBlue on 15/5/21.
 */

@Table("ks_notice")
public class Notice {

    @Id
    private int id;

    @Column
    private int design_id;

    @Column
    private int type;

    @Column
    private int user_id;

    @Column
    private int is_read;

    @One(target = Design.class, field = "design_id")
    private Design design;

    @One(target = User.class, field = "user_id")
    private User user;

    public Design getDesign() {
        if (this.design == null) {
            DbUtils.getNutzDao().fetchLinks(this, "design");
            return this.design;
        } else
            return this.design;
    }

    public void setDesign(Design design) {
        this.design = design;
    }

    public User getUser() {
        if (this.user == null) {
            DbUtils.getNutzDao().fetchLinks(this, "user");
            return this.user;
        } else
            return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getDesign_id() {
        return design_id;
    }

    public void setDesign_id(int design_id) {
        this.design_id = design_id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getIs_read() {
        return is_read;
    }

    public void setIs_read(int is_read) {
        this.is_read = is_read;
    }
}
